-
Notifications
You must be signed in to change notification settings - Fork 8
Fix devcontainer to properly restore projects with private NuGet feed using interactive authentication #778
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix devcontainer to properly restore projects with private NuGet feed using interactive authentication #778
Conversation
Co-authored-by: BenjaminMichaelis <[email protected]>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
Fixes devcontainer configuration to enable proper package restoration when using private Azure DevOps NuGet feeds, ensuring developers can work seamlessly in GitHub Codespaces or local devcontainer environments.
- Enhanced devcontainer.json with .NET 9.0 SDK, VS Code C# extensions, and authentication setup
- Added automated NuGet authentication script with Azure DevOps PAT support and graceful fallback
- Created comprehensive documentation and templates for developer onboarding
Reviewed Changes
Copilot reviewed 4 out of 5 changed files in this pull request and generated 2 comments.
| File | Description |
|---|---|
| .devcontainer/setup-nuget-auth.sh | Automated script for installing Azure Artifacts Credential Provider and configuring NuGet authentication |
| .devcontainer/devcontainer.json | Updated container configuration with .NET 9.0, VS Code extensions, and post-create setup command |
| .devcontainer/README.md | Comprehensive setup documentation with authentication instructions and troubleshooting guide |
| .devcontainer/.env.template | Template file for local Azure DevOps PAT configuration |
Co-authored-by: Copilot <[email protected]>
|
@copilot Instead of providing the PAT in the repo, should we just run |
You're absolutely right! The interactive approach is more secure and simpler. I'll update the setup to install the credential provider and use |
Co-authored-by: BenjaminMichaelis <[email protected]>
The devcontainer configuration was missing authentication setup for the private Azure DevOps NuGet feed, preventing proper package restoration when using GitHub Codespaces or local devcontainer development.
Problem
The existing devcontainer would fail to restore packages that depend on private NuGet packages from the Azure DevOps feed (
https://pkgs.dev.azure.com/intelliTect/_packaging/EssentialCSharp/nuget/v3/index.json). This affected packages like:ContentFeedNugetEssentialCSharp.Shared.ModelsSolution
This PR implements a secure interactive authentication solution using Microsoft's recommended approach for Azure Artifacts Credential Provider:
Key Changes
Enhanced devcontainer.json:
Interactive Authentication Setup:
setup-nuget-auth.shscript that:dotnet restore --interactivefor secure credential promptingDeveloper Experience:
Authentication Options
Interactive Authentication: When prompted during package restoration, users can:
Backward Compatibility
The solution is fully backward compatible:
Testing
This brings the devcontainer authentication in line with Microsoft's recommended security practices while ensuring consistent development environments across local development, Codespaces, and CI/CD pipelines.
✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.